//
//  OAuthViewModel.h
//  OSChina
//
//  Created by 8b410-2 on 16/12/22.
//  Copyright © 2016年 abb. All rights reserved.
//

#import "OSCBaseViewModel.h"
#import "OSCOAuthRequestParams.h"
#import "OSCValidationAccountRequestParams.h"
#import "OSCAccount.h"
@interface OSCOAuthViewModel : OSCBaseViewModel
/// oauth请求参数
@property (nonatomic, strong) OSCOAuthRequestParams *oauthParams;
/// 验证账户请求参数
@property (nonatomic, strong) OSCValidationAccountRequestParams *validationAccountParams;
/// token请求
@property (nonatomic, strong) RACCommand *tokenCommand;
/// 账户验证请求
@property (nonatomic, strong) RACCommand *validationCommand;
/// 刷新token请求
@property (nonatomic, strong) RACCommand *refreshTokenCommand;
/// oauth请求地址
@property (nonatomic, strong) NSURL *oauthUrl;
/// 账户验证通过
@property (nonatomic, assign) BOOL validationAccount;
/// 是否显示验证码框
@property (nonatomic, assign) BOOL showCaptchaView;
/// 验证码js代码
@property (nonatomic, copy, readonly) NSString *jsForCaptchaImageUrl;
/// 请求codejs代码
@property (nonatomic, copy, readonly) NSString *jsForRequestCode;
/// 登录按钮允许点击信号
@property (nonatomic, strong) RACSignal *enableLoginActive;

/**
 加密密码js代码

 @param password 要加密的密码
 @return js代码
 */
- (NSString *)jsForEncryptionPassword:(NSString *)password;

/**
 根据标签id拿到标签值

 @param tagId 标签id
 @return js代码
 */
- (NSString *)stringForJsTagById:(NSString *)tagId;

/**
 根据标签id设置标签值

 @param value 要设置的值
 @param tagId 标签id
 @return js代码
 */
- (NSString *)stringForSetValue:(NSString *)value ForJsTagById:(NSString *)tagId;
- (void)dismissViewModel;
@end
